Add documents to SearchResults.
C#
public void AddDocs(
ref String indexPath,
ref array<long> docIds
);
Parameters
Parameters |
Description |
---|---|
indexPath |
Path of the index that contains the documents. |
docIds |
Document ids of the documents to add. |
Remarks
When adding more than one document to SearchResults, AddDocs is faster than AddDoc because the index is only opened once.
SearchResults.AddDocs can be used to convert a SearchFilter to a SearchResults object containing the same documents. First call SearchFilter.GetItems() to get an array the of document ids in the SearchFilter, and then call SearchResults.AddDocs() to add the document ids to a SearchResults object. Example:
private SearchResults ConvertFilterToResults(SearchFilter filter, int iIndex)
{
int[] docIds = filter.GetItems(iIndex);
SearchResults results = new SearchResults();
results.AddDocs(filter.getIndexPath(iIndex), docIds);
return results;
}
See Also